﻿using Xejen.Communication.Configuration;
using Xejen.Communication.Endpoints;
using Xejen.Communication.Logger;
using Xejen.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Remoting.Contexts;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace Xejen.Communication.Socket.Client.Test
{
    public partial class MainForm : Form
    {
        private readonly IConfiguration _configuration;
        private readonly Service _service;
        private readonly IAppHost _host;

        public MainForm(Service service, IConfiguration configuration, IAppHost host)
        {
            _service = service;
            _configuration = configuration;
            _host = host;

            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


        }

        private async void button1_Click_1(object sender, EventArgs e)
        {

            Service service = _host.ServiceProvider.GetService(typeof(Service)) as Service;
            await service.ExecuteAsync();

            //await _service.ExecuteAsync();
        }
    }
}